//导入vue
import Vue from 'vue';

//导入App.vue的vue对象
import App from './App.vue';

//导入路由模块
 import vueRouter from 'vue-router';

 //绑定路由
 Vue.use(vueRouter);
//创建路由对象
 import home from './components/home.vue' ;
 import shopcar from './components/shopcar/car.vue';
 import goodslist from './components/goods/goodslist.vue';
 import newslist from './components/news/newslist.vue';
 import imglist from './components/imgshare/imglist.vue';
 import imgdetail from './components/imgshare/imgdetail.vue';
 import feedback from './components/feedback/feedback.vue';
 import videolist from './components/video/videolist.vue';
 import concat from './components/concat/concat.vue';
 import newsinfo from './components/news/newsinfo.vue';
 import getdesc from './components/goods/getdesc.vue';
 import goodsdesc from './components/goods/goodsdesc.vue'
 import goodscomment from './components/goods//goodscom.vue'

 //配置路由规则
 var router=new vueRouter({
     linkActiveClass:'mui-active',
     routes:[
         {path:'/home',component:home},//首页         
         {path:'/shopcar',component:shopcar}, //购物车       
         {path:'/goods/goodslist',component:goodslist},//商品列表
         {path:'/news/newslist',component:newslist},//新闻列表
         {path:'/imgshare/imglist',component:imglist},//图片分享
         {path:'/imgshare/imgdetail/:id',component:imgdetail},//图片详情页
         {path:'/feedback/feedback',component:feedback},//反馈
         {path:'/video/videolist',component:videolist},//视频专区
         {path:'/concat/concat',component:concat},//联系我们
         {path:'/news/newsinfo/:id',component:newsinfo},//新闻列表详情
         {path:'/goods/getdesc/:id',component:getdesc},
         {path:'/goods/getdesc/:id',component:getdesc},
         {path:'/goods/goodsdesc/:id',component:goodsdesc},
         {path:'/goods/goodscomment/:id',component:goodscomment},
         {path:'/',redirect:'/home'}
     ]
 })

 //使用mint ui
import 'mint-ui/lib/style.min.css'
import Mint from 'mint-ui';
Vue.use(Mint);
//导入vue-resource
import vueResource from 'vue-resource'
Vue.use(vueResource);
//使用mui组件
import '../statics/mui/css/mui.css'
import '../statics/mui/css/icons-extra.css'
//导入全局样式
import "../statics/css/site.css"
//导入moment
import moment from 'moment';
Vue.filter("datefmt",function(input,fmtstring){
    //使用moment实现日期格式化
    return moment(input).format(fmtstring);
})
//引入图片预览功能
import VuePreview from 'vue-preview';
Vue.use(VuePreview);
 //利用vue对象进行解析渲染
 new Vue({
     el:'#app',
     router,
    //  render:function(create){create(App)}
    render:c=>c(App)
 })


